﻿@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section header{

}

<body>
    <div class="layui-fluid">
        <div class="layui-row">
            <form class="layui-form" action="" lay-filter="example">
                <input type="hidden" name="taskId" value="@ViewBag.Taskid" />
                <div class="layui-form-item">
                    <label class="layui-form-label">截止日期</label>
                    <div class="layui-input-block">
                        <input type="text" class="layui-input" id="startTime" name="startTime" placeholder="yyyy-MM-dd">
                    </div>
                </div>

                <div class="layui-form-item" style="text-align: center;">
                    <button class="layui-btn" lay-submit="" lay-filter="save">保存</button>
                    <button type="button" class="layui-btn layui-btn-primary" function="close">关闭</button>
                </div>
            </form>
        </div>
    </div>
</body>

<script>
    layui.use(['form', 'laydate'], function () {
        var form = layui.form;
        var laydate = layui.laydate;

        //日期时间选择器
        laydate.render({
            elem: '#startTime'
            , type: 'date'
        });

        $("[function='close']").click(function () {
            common.closeOpen();
        });

        form.on('submit(save)', function (data) {

            layer.confirm('确定重新初始化吗?', function (index) {
                request.ajax({
                    type: "post",
                    url: "/Schedule/DeleteLog",
                    data: data.field,
                    success: function (data) {
                        if (data.success) {
                            $('#isReload', window.parent.document).val("1");
                            common.closeOpen();
                        }
                        else {
                            common.errorMsg(data.message);
                        }
                    }
                });
            });
            return false;
        });
    });
</script>